package com.huawang.ecolink.apps.common.eums;

public enum PrimitiveTypeMappingEnum {
    REAL("Real", "LiteralReal"),
    BOOLEAN("Boolean", "LiteralBoolean"),
    STRING("String", "LiteralString"),
    INTEGER("Integer", "LiteralInteger"),
    COMPLEX("Complex","SysML_dataType.Complex"),
    INSTANCE("Instance", "InstanceValue");
    private final String moType;
    private final String designType;

    PrimitiveTypeMappingEnum(String moType, String designType) {
        this.moType = moType;
        this.designType = designType;
    }

    public String getMoType() {
        return moType;
    }

    public String getDesignType() {
        return designType;
    }

    //通过ID获取枚举值
    public static PrimitiveTypeMappingEnum getDesignTypeByMoType(String moType) {
        if (moType == null) {
            return null;
        }
        for (PrimitiveTypeMappingEnum v : values()) {
            if (v.moType.equals(moType)) {
                return v;
            }
        }
        return null;
    }

}
